In many computer systems, real time is computed internally by a microprocessor. A highly accurate microprocessor bus oscillator acts as a clock source. For example, a 14.3 MHZ oscillator may act as a clock source, generating 14,300,000 ticks (i.e. cycles) per second. Clock ticks are accumulated in a high speed counter (i.e. decrementer), or system Real Time Clock (RTC). Real time is calculated as a function of the decrementer value and the known oscillator frequency. For example, if the decrementer has a value of 3 million ticks at time one, and a value of 2 million ticks at time two, then it can be determined that 0.0699 seconds have elapsed between time one and time two ((3 million-2 million)/14.3 million). The frequency of the microprocessor bus oscillator is specified over a given temperature and voltage range. This means that the frequency of the microprocessor bus oscillator will remain within a specified range over the given temperature and voltage range.
When a computer system is powered down, the system RTC value must be saved in a battery-backed up RTC. The battery-backed up RTC is a low power circuit, typically operating from a time base of 32,768 Hz (32 KHz). While the computer system is powered down, time is computed and saved in the battery-backup up RTC. However, the battery-backed up RTC is not nearly as accurate as the system RTC. This is because the frequency of the 32 KHz oscillator driving the battery-backed up RTC varies greatly as a function of temperature. A typical error margin is -0.04.times.(delta T).times.(delta T), where (delta T) is the deviation from a nominal temperature of 25 degrees Celsius. Thus, the 32 KHz oscillator has a temperature coefficient with an inverse parabolic function, and the more the temperature varies from 25 degrees Celsius, the slower the battery-backed up RTC runs.
When power is restored to the computer, the battery-backed up RTC is copied into the system RTC, and the microprocessor's decrementer again keeps track of real time. However, any errors accumulated while the computer was powered off are inherited by the system RTC when the computer is powered on. A prior art method for dealing with this problem is the use of temperature-compensated 32 KHz oscillators to drive the battery backed up clock when the system is powered down. However, temperature-compensated oscillators are expensive, and are not typically suitable for battery operation.
Consequently, it would be desirable to have a low-cost method and apparatus for driving a battery-backed up RTC while a computer system is powered down. It would also be desirable to ensure accurate time-keeping by the battery-backed up clock while the system is powered down, and to minimize timing errors inherited by the system RTC when the system is powered on.